<?php

/**
 * Ftpquotatallies form base class.
 *
 * @package    form
 * @subpackage ftpquotatallies
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseFtpquotatalliesForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'              => new sfWidgetFormInputHidden(),
      'name'            => new sfWidgetFormInput(),
      'quota_type'      => new sfWidgetFormChoice(array('choices' => array('user' => 'user', 'group' => 'group', 'class' => 'class', 'all' => 'all'))),
      'bytes_in_used'   => new sfWidgetFormInput(),
      'bytes_out_used'  => new sfWidgetFormInput(),
      'bytes_xfer_used' => new sfWidgetFormInput(),
      'files_in_used'   => new sfWidgetFormInput(),
      'files_out_used'  => new sfWidgetFormInput(),
      'files_xfer_used' => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'              => new sfValidatorDoctrineChoice(array('model' => 'Ftpquotatallies', 'column' => 'id', 'required' => false)),
      'name'            => new sfValidatorString(array('max_length' => 30)),
      'quota_type'      => new sfValidatorChoice(array('choices' => array('user' => 'user', 'group' => 'group', 'class' => 'class', 'all' => 'all'))),
      'bytes_in_used'   => new sfValidatorInteger(),
      'bytes_out_used'  => new sfValidatorInteger(),
      'bytes_xfer_used' => new sfValidatorInteger(),
      'files_in_used'   => new sfValidatorInteger(),
      'files_out_used'  => new sfValidatorInteger(),
      'files_xfer_used' => new sfValidatorInteger(),
    ));

    $this->widgetSchema->setNameFormat('ftpquotatallies[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Ftpquotatallies';
  }

}
